<?php
session_start();
require('connect.php');
$name=$_SESSION['username'];
$comment=$_POST['comment'];
$submit=$_POST['submit'];
if($submit)
{
    if($name&&$comment)
    {
    $query=mysql_query("INSERT INTO comment (id,name,comment) VALUES ('','$name','$comment')");
    header("Location: ../../index.php");
    }
    else
    {
        header("Location: ../../index.php");
    }
}
?>

</html>